CC=g++
CFLAGS=-W -wall -ansi -pedantic
LDFLAGS=-lcv -lhighgui -lcvaux
SRC=$(wildcard *.cpp) 
OBJ=$(SRC:.cpp=.o)
EXEC=splitmerge

all: $(EXEC)

$(EXEC): $(OBJ)
	$(CC) -o $@ $^ $(LDFLAGS)

main.o: quadtree.h image.h window.h
node.o: node.h
quadtree.o: quadtree.h
window.o: window.h
image.o: image.h

%.o: %.c
	$(CC) -o $@ -c $< $(CFLAGS)

.PHONY: clean veryclean	

clean:
	rm *.o

veryclean: clean
	rm $(EXEC)


